home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2001 February / Internet Magazine February 2001.iso / mac / SOFTWARE / MAC / WEB EDITORS / HTML_OPTIMIZER / HTMLOPTIMIZER.HQX / HTML Optimizer 3.3.2ƒ / HTML Optimizer 3.3.2 / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  2000-12-11  |  15.6 KB  |  20 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.2</name>
  5.     <id>-1</id>
  6.     <cardCount>1</cardCount>
  7.     <cardID>3037</cardID>
  8.     <listID>2335</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>416</width>
  14.         <height>296</height>
  15.     </cardSize>
  16.     <script>on openStack
  17. global noAS
  18. if the heapSpace < 600000 then
  19. beep
  20. answer "HyperCard's memory partition is set too low."&return&┬¼
  21. "Quit HyperCard, select the HyperCard icon and choose Info from the File menu."&&┬¼
  22. "Set the memory partition in the Info window to 3000 kB." with "Quit"
  23. set lockErrorDialogs to true
  24. doMenu "Quit HyperCard"
  25. exit openStack
  26. end if
  27. if the version < 2.3 then
  28. beep
  29. answer "You don't have the right version of HyperCard (Player). Use version 2.3 or higher."
  30. set lockErrorDialogs to true
  31. doMenu "Quit HyperCard"
  32. exit openStack
  33. end if
  34. push this cd
  35. cleanUp
  36. if char 1 of GetMode() is not "B" then
  37. AddColor install,16
  38. put the result into thisResult
  39. hide bg btn id 5
  40. else
  41. put empty into thisResult
  42. show bg btn id 5
  43. end if
  44. put WriteReadPrefs("read","HTML Optimizer Preferences") into prefs
  45. if prefs contains "Can't find file" then
  46. put "installed" into btn id 65
  47. put WriteReadPrefs("write","HTML Optimizer Preferences","installed") into this
  48. else put "moved" into btn id 65
  49. put false into noAS
  50. lock screen
  51. CheckStatus prefs
  52. hide btn id 49
  53. AddColor colorCard,barnDoorOpen,25
  54. unlock screen with barn door open fast
  55. do btn id 5
  56. checkcolor thisResult
  57. if last word of cd fld "AboutΓǪ" is a number then delete last word of cd fld "AboutΓǪ"
  58. initialize
  59. checkRepeat
  60. pass openStack
  61. end openStack
  62.  
  63. on closeStack
  64. if freeSize of this stack > 2500 and the cantModify of this stack is false
  65. then doMenu "Compact Stack"
  66. enableThings
  67. reset menuBar
  68. if hilite of btn id 49 is false then set hilite of btn id 49 to true
  69. lock screen
  70. prepareIntro
  71. show btn id 49
  72. FullBalloons "off"
  73. AddColor remove
  74. pass closeStack
  75. end closeStack
  76.  
  77. on resumeStack
  78. cleanUp
  79. pass resumeStack
  80. end resumeStack
  81.  
  82. on suspendStack
  83. reset menuBar
  84. FullBalloons "off"
  85. pass suspendStack
  86. end suspendStack
  87.  
  88. on cleanUp
  89. if visible of msg then hide msg
  90. if visible of tool window then hide tool window
  91. if visible of pattern window then hide pattern window
  92. reset menuBar
  93. put "About HTML OptimizerΓǪ" into menuItem 1 of menu 1 with menuMsg "aboutOptimizer"
  94. if number of menuItems of menu "File" > 7 then
  95. put number of menuItems of menu "File" into n
  96. repeat with i = n-2 down to 7
  97. delete menuItem i of menu "File"
  98. end repeat
  99. delete menuItem 1 of menu "File"
  100. end if
  101. if there is a menu "Edit" then delete menu "Edit"
  102. if there is a menu "Go" then
  103. if number of menuItems of menu "Go" > 4 then
  104. repeat until number of menuItems of menu "Go" is 2
  105. delete last menuItem of menu "Go"
  106. end repeat
  107. end if
  108. end if
  109. if there is a menu "Style" then delete menu "Style"
  110. if there is a menu "Font" then delete menu "Font"
  111. if there is a menu "Tools" then delete menu "Tools"
  112. if there is a menu "Objects" then delete menu "Objects"
  113. if there is a menu "Color" then delete menu "Color"
  114. if there is not a menu "Configure" then create menu "Configure"
  115. put "Define Location for Optimizer Output FolderΓǪ,Confirm Standard Internet Browser,-,About this MenuΓǪ"┬¼
  116. into menu "Configure" with menuMsg "config1,config2,,aboutConfig"
  117. if rect of cd fld "BlueLine" is not "16,185,400,187" then set rect of cd fld "BlueLine" to "16,185,400,187"
  118. if rect of cd fld "SmallBlueLine1" is not "17,52,154,55" then set rect of cd fld "SmallBlueLine1" to "17,52,154,55"
  119. if rect of cd fld "SmallBlueLine2" is not "260,52,395,55" then set rect of cd fld "SmallBlueLine2" to "260,52,395,55"
  120. if cd fld "storePath" is not in long name of this stack then
  121. buttonStyles
  122. put empty into btn id 26
  123. put empty into btn id 42
  124. put empty into btn id 115
  125. end if
  126. disable btn id 115
  127. put long name of this stack into stackPath
  128. set the itemDelimiter to colon
  129. delete word 1 of stackPath
  130. delete char 1 of stackPath
  131. delete last item of stackPath
  132. put ":" after stackPath
  133. put stackPath into btn id 71
  134. set the itemDelimiter to comma
  135. if short name of btn id 5 is "Hide Info" then send mouseUp to btn id 5
  136. set scroll of cd fld "Intro" to 0
  137. if the systemVersion < 8.5 then
  138. set textStyle of word 1 to 2 of cd fld "Welcome" to bold
  139. else set textStyle of word 1 to 2 of cd fld "Welcome" to plain
  140. end cleanUp
  141.  
  142. on aboutOptimizer
  143. lock screen
  144. set textSize of line 2 of cd fld "AboutΓǪ" to 14
  145. set textStyle of line 2 of cd fld "AboutΓǪ" to bold
  146. set textSize of line 4 of cd fld "AboutΓǪ" to 12
  147. set textSize of line 6 of cd fld "AboutΓǪ" to 10
  148. show cd fld "AboutΓǪ"
  149. AddColor colorCard,irisOpen,15
  150. unlock screen with iris open fast
  151. wait 15
  152. if the mouseClick then exitAbout
  153. lock screen
  154. put "Checks all tagged pairs" into line 4 of cd fld "AboutΓǪ"
  155. AddColor colorCard,barndoorclose,40
  156. unlock screen with iris open fast
  157. wait 15
  158. if the mouseClick then exitAbout
  159. lock screen
  160. put "Marks all dangling tags" into line 4 of cd fld "AboutΓǪ"
  161. AddColor colorCard,barndoorclose,40
  162. unlock screen with iris open fast
  163. wait 15
  164. if the mouseClick then exitAbout
  165. lock screen
  166. put "Converts special characters" into line 4 of cd fld "AboutΓǪ"
  167. AddColor colorCard,barndoorclose,40
  168. unlock screen with iris open fast
  169. wait 15
  170. if the mouseClick then exitAbout
  171. lock screen
  172. put "Optimizes your web pages" into line 4 of cd fld "AboutΓǪ"
  173. AddColor colorCard,barndoorclose,40
  174. unlock screen with iris open fast
  175. wait 15
  176. if the mouseClick then exitAbout
  177. lock screen
  178. put "Copyright (1999-2000) Ton Brand" into line 4 of cd fld "AboutΓǪ"
  179. AddColor colorCard,barndoorclose,40
  180. unlock screen with barn door close
  181. wait 15
  182. if the mouseClick then exitAbout
  183. lock screen
  184. hide cd fld "AboutΓǪ"
  185. AddColor colorCard,irisClose,20
  186. unlock screen with iris close fast
  187. send mouseUp to this cd
  188. end aboutOptimizer
  189.  
  190. on exitAbout
  191. lock screen
  192. hide cd fld "AboutΓǪ"
  193. send mouseUp to this cd
  194. unlock screen
  195. exit to HyperCard
  196. end exitAbout
  197.  
  198. on buttonStyles
  199. if systemFont() is Chicago then
  200. repeat with i = 1 to number of btns
  201. set textFont of btn i to Chicago
  202. set textStyle of btn i to plain
  203. end repeat
  204. else if systemFont() is Charcoal then
  205. repeat with i = 1 to number of btns
  206. set textFont of btn i to Charcoal
  207. set textStyle of btn i to plain
  208. end repeat
  209. else
  210. repeat with i = 1 to number of btns
  211. set textFont of btn i to Geneva
  212. set textStyle of btn i to bold,condense
  213. end repeat
  214. end if
  215. if char 1 of GetMode() is "B" then
  216. set hilite of btn "ProgressBase" to true
  217. set style of btn "OptimizeΓǪ" to default
  218. set style of btn "Save" to default
  219. set height of btn "OptimizeΓǪ" to 26
  220. set height of btn "Save" to 26
  221. else
  222. set hilite of btn "ProgressBase" to false
  223. set style of btn "OptimizeΓǪ" to transparent
  224. set style of btn "Save" to transparent
  225. set height of btn "OptimizeΓǪ" to 18
  226. set height of btn "Save" to 18
  227. end if
  228. end buttonStyles
  229.  
  230. on disableThings
  231. lock screen
  232. hide cd fld "Intro"
  233. hide cd fld "BlueLine"
  234. disable btn "Quit"
  235. disable btn "PrintΓǪ"
  236. disable btn "OptimizeΓǪ"
  237. disable btn "Check TagsΓǪ"
  238. disable btn "Mark TagsΓǪ"
  239. disable btn "ConvertΓǪ"
  240. disable btn "PreferencesΓǪ"
  241. disable btn "View Page"
  242. disable btn id 5
  243. hideThings
  244. hideThings
  245. AddColor colorCard,stamp,0
  246. unlock screen
  247. end disableThings
  248.  
  249. on enableThings
  250. lock screen
  251. show cd fld "Intro"
  252. show cd fld "BlueLine"
  253. enable btn "Quit"
  254. enable btn "PrintΓǪ"
  255. enable btn "OptimizeΓǪ"
  256. enable btn "Check TagsΓǪ"
  257. if "unregistered" is not in cd fld "AboutΓǪ" then enable btn "Mark TagsΓǪ"
  258. enable btn "ConvertΓǪ"
  259. enable btn "PreferencesΓǪ"
  260. enable btn "Not Yet"
  261. enable btn "RegisterΓǪ"
  262. enable btn id 5
  263. if visible of cd fld "Prefs" then send mouseUp to btn "Cancel"
  264. if visible of btn id 109 then send mouseUp to btn id 109
  265. hideThings
  266. AddColor colorCard,stamp,0
  267. unlock screen
  268. end enableThings
  269.  
  270. on hideThings
  271. hide cd fld "Status"
  272. hide cd fld "Progress"
  273. hide cd fld "Log"
  274. hide btn "ProgressBase"
  275. if visible of cd fld "About" then
  276. hide cd fld "About"
  277. set name of btn id 5 to "Author Info"
  278. end if
  279. end hideThings
  280.  
  281. on hidePrefs
  282. hide cd fld "Prefs"
  283. hide cd fld "Fake1"
  284. hide cd fld "Fake2"
  285. hide cd fld "Fake3"
  286. hide cd fld "Fake4"
  287. hide cd fld "Fake5"
  288. hide cd fld "SmallBlueLine1"
  289. hide cd fld "SmallBlueLine2"
  290. hide btn id 28
  291. hide btn id 29
  292. hide btn id 30
  293. hide btn id 34
  294. hide btn id 35
  295. hide btn id 37
  296. hide btn id 38
  297. hide btn id 39
  298. hide btn id 44
  299. hide btn id 53
  300. hide btn id 60
  301. hide btn id 61
  302. hide btn id 68
  303. hide btn id 96
  304. hide btn id 119
  305. hide btn id 127
  306. AddColor removeObject,cd,26
  307. end hidePrefs
  308.  
  309. on checkColor thisResult
  310. if "Error" is in thisResult then
  311. beep
  312. answer "Color is missing because HyperCard's memory partition is set too low."&return&┬¼
  313. "Quit HyperCard and when in the Finder, select the HyperCard icon and increase"&&┬¼
  314. "HyperCard's memory partition via Info from the File menu." with "Cancel","Quit"
  315. if it is "Quit" then doMenu "Quit HyperCard"
  316. end if
  317. end checkColor
  318.  
  319. on initialize
  320. if cd fld "storePath" is not in long name of this stack then
  321. put long name of this stack into temp
  322. delete word 1 of temp
  323. delete char 1 of temp
  324. delete last char of temp
  325. set the itemDelimiter to colon
  326. put item 1 of temp &":"& item 2 of temp into cd fld "storePath"
  327. set the itemDelimiter to comma
  328. send mouseUp to btn "Default"
  329. if the cantModify of this stack is false then
  330. if the systemVersion < 7.5 then
  331. beep
  332. answer "Your system version is lower than 7.5."&return&"You may not be able to go"&&┬¼
  333. "online from HTML Optimizer."
  334. end if
  335. disable btn id 83
  336. disable btn id 84
  337. disableThings
  338. send mouseUp to btn "Welcome"
  339. send mouseUp to btn "chooseFolderPath"
  340. enable btn id 83
  341. enable btn id 84
  342. enableThings
  343. else
  344. beep
  345. answer "Sorry, you can't run this program from CD-ROM. It will quit now."
  346. doMenu "Quit HyperCard"
  347. end if
  348. end if
  349. end initialize
  350.  
  351. on config1
  352. Fullballoons "isOn"
  353. if the result then Fullballoons "Off"
  354. send mouseUp to btn "selectFolderPath"
  355. if btn id 26 is empty then
  356. answer folder "Select a folder in which you want the Optimizer Output folder."&┬¼
  357. return&"When done, go to the Finder and make the Optimizer Output folder in that location."&return&return
  358. if the result is "Cancel" then
  359. exit to HyperCard
  360. else put it into btn id 26
  361. end if
  362. end config1
  363.  
  364. on config2
  365. put empty into btn id 115
  366. if the systemVersion < 8.5 then
  367. put "Internet Config" into text1
  368. else put "the control panel Internet" into text1
  369. answer "HTML Optimizer will use your standard Internet browser as set in"&&text1&"."
  370. end config2
  371.  
  372. on aboutConfig
  373. answer "If you wish to change the location of the Optimizer Output folder"&&┬¼
  374. "or re-confirm it after an error message, or if you wish to confirm a different standard"&&┬¼
  375. "Internet browser, then you need to choose the appropriate menu command from the Configure menu."
  376. end aboutConfig
  377.  
  378. on mouseWithin
  379. FullBalloons "isOn"
  380. if not the result then
  381. set hilite of btn "Balloon Help" to false
  382. else set hilite of btn "Balloon Help" to true
  383. FullBalloons "isShowing"
  384. if not the result and the mouseLoc is within the rect of the target then send mouseEnter to the target
  385. end mouseWithin
  386.  
  387. on idle
  388. global showLog,thisSelect
  389. if visible of cd fld "Status" then put true into showLog
  390. if not enabled of btn "Quit" then enableThings
  391. if showLog is true then
  392. if "Stopped by user" is not in cd fld "Log" then
  393. put return&return&"Stopped by user." after cd fld "Log"
  394. if not enabled of btn "View Page" and thisSelect is "one" then
  395. put "The log is in the Optimizer Output folder." into line 3 to 4 of cd fld "Log"
  396. end if
  397. end if
  398. if not visible of cd fld "Log" then
  399. show cd fld "Log"
  400. disable btn "PrintΓǪ"
  401. put false into showLog
  402. saveLog
  403. end if
  404. end if
  405. pass idle
  406. end idle
  407.  
  408. on saveLog
  409. global whatLog
  410. if not hilite of btn id 44 then checkLogSize whatLog
  411. put cd fld "Log"&return&"-------------------------------------------------------"&┬¼
  412. return into tempLog
  413. put whatLog&&the short date&&"Γùè"&&the long time&return into line 1 to 3 of tempLog
  414. if hilite of btn id 44 then
  415. WriteToFile tempLog,true,btn id 26&"Optimizer Output:"&whatLog,false,ttxt
  416. else WriteToFile tempLog,true,btn id 26&"Optimizer Output:"&whatLog,true,ttxt
  417. if word 1 of the result contains "Error" then
  418. put the result into theResult
  419. errorMessage theResult
  420. end if
  421. end saveLog
  422.  
  423. on checkLogSize whatLog
  424. open file btn id 26&"Optimizer Output:"&whatLog
  425. if the result is empty then
  426. read from file btn id 26&"Optimizer Output:"&whatLog until eof
  427. put it into thisLog
  428. close file btn id 26&"Optimizer Output:"&whatLog
  429. if length of thisLog > 29000 then
  430. beep
  431. answer "The "&whatLog&" in your Optimizer Output folder approaches its 32K limit."&┬¼
  432. return&"Do you want to clear it before you store new data?" with "Clear Log","Not Yet"
  433. if it is "Clear Log"
  434. then WriteToFile "",true,btn id 26&"Optimizer Output:"&whatLog,false,ttxt
  435. end if
  436. end if
  437. end checkLogSize
  438.  
  439. on errorMessage theResult,thisPage
  440. global noAS
  441. if thisPage is empty then
  442. put "the log" into thisPage
  443. else put quote&thisPage&quote into thisPage
  444. beep
  445. if 120 is in theResult then
  446. put "Could not find the folder "&quote&"Optimizer Output"&quote&" at the location <"&┬¼
  447. btn id 26&">."&return&"Please make this folder and select the same"&&┬¼
  448. "web page of folder again." into errMsg
  449. if length of errMsg > 254 then
  450. repeat until length of errMsg = 254
  451. delete last char of errMsg
  452. end repeat
  453. put "ΓǪ" into last char of errMsg
  454. end if
  455. if noAS is true then -- AppleScript has not worked
  456. answer "Could not find the folder "&quote&"Optimizer Output"&quote&"."&return&┬¼
  457. "Please go to the Finder and make this folder in HTML Optimizer's parent folder."&┬¼
  458. return&return&"(HyperCard will quit)"
  459. lock screen
  460. hideThings
  461. prepareIntro
  462. show btn id 49
  463. FullBalloons "off"
  464. doMenu "Quit HyperCard"
  465. exit to HyperCard
  466. else
  467. answer errMsg
  468. end if
  469. set the itemDelimiter to colon
  470. put last item of btn id 26 into btn id 42
  471. set the itemDelimiter to comma
  472. answer folder "In which folder must "&quote&"Optimizer Output"&quote&" be placed?"&return&┬¼
  473. "(your earlier choice was "&quote&btn id 42&quote&")"&return&return
  474. if the result is "Cancel" then exit to HyperCard
  475. put it into btn id 26
  476. if button id 26 Γëá empty then
  477. send mouseUp to btn "makeFolder"
  478. send mouseUp to the target
  479. end if
  480. enableThings
  481. exit to HyperCard
  482. else if 49 is in theResult then
  483. answer "Could not save"&&thisPage&&"because the existing file is in use."
  484. else if 37 is in theResult then
  485. answer "Could not save"&&thisPage&&"because its name is too long."
  486. else if 35 is in theResult then
  487. put item 1 of btn id 26 into thisVolume
  488. delete last char of thisVolume
  489. answer "Could not save"&&thisPage&&"because the volume "&quote&thisVolume&┬¼
  490. quote&&"was not found."&return&"Tip: Move HTML Optimizer to another location and re-start it."&┬¼
  491. return&return&"(HyperCard will quit)"
  492. lock screen
  493. hideThings
  494. prepareIntro
  495. show btn id 49
  496. FullBalloons "off"
  497. doMenu "Quit HyperCard"
  498. exit to HyperCard
  499. else answer "Sorry, an error has occurred while saving"&&thisPage&"."&return&return&theResult
  500. end errorMessage
  501.  
  502. on returnKey
  503. if not visible of msg then
  504. if visible of cd fld "Prefs" then
  505. click at loc of btn "Save"
  506. else click at loc of btn "OptimizeΓǪ"
  507. else pass returnKey
  508. end returnKey
  509.  
  510. on enterKey
  511. if not visible of msg then
  512. if visible of cd fld "Prefs" then
  513. click at loc of btn "Save"
  514. else click at loc of btn "OptimizeΓǪ"
  515. else pass enterKey
  516. end enterKey
  517.  
  518. on keyDown key
  519. if the optionKey is down then
  520. if key Γëá tab then
  521. pass keyDown
  522. end if
  523. else pass keyDown
  524. end keyDown
  525.  
  526. on AC_Transitions
  527. end AC_Transitions
  528.  
  529.  
  530.  
  531. </script>
  532.     <background id="2606" file="background_2606.xml" name="" />
  533.     <card id="3037" file="card_3037.xml" marked="false" name="" owner="2606" />
  534. </stack>
  535.